{# empty Twig template #}
{% extends'CNAMActimanBundle::layoutBody.html.twig' %}
{% block body %}
    
    {% block content %}
        <div class="col-lg-12">
            <h2>Liste des agents affectés</h2>
            <hr align="center" width="90%" size="5">
            <div class="col-lg-12">
                {% set nomagent, prenomagent = "", "" %}
                {% for tache in list_tache %}
                    {% if tache.user.nomUser != nomagent and tache.user.prenomUser != prenomagent %}
                    <div class="panel panel-primary">              
                        <div class="panel-heading">
                            <h3 class="panel-title">
                                {{ tache.user.nomUser }} {{ tache.user.prenomUser }} - Service : {{ tache.user.service.nomService }}
                            </h3>
                        </div>
                        <div class="panel-body">
                            <div class="table-responsive">
                                <table class="table table-bordered table-hover table-striped tablesorter">  
                                    {% if tache.user.nomUser != nomagent and tache.user.prenomUser != prenomagent %}
                                        <thead>
                                            <tr>
                                                <th width="30%">Tâche <i class="fa fa-sort"></i></th>
                                                <th width="30%">Phase associée <i class="fa fa-sort"></i></th>
                                                <th width="30%">Procédure associée <i class="fa fa-sort"></i></th>
                                                <th width="10%"><center>Détail </center></th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            {% set nomagent, prenomagent = tache.user.nomUser, tache.user.prenomUser %}
                                            {% for tache in list_tache %}
                                                {% if tache.user.nomUser == nomagent and tache.user.prenomUser == prenomagent %}
                                                    <tr>
                                                        <td>{{ tache.nomTache}}</td>
                                                        <td>{{ tache.phasePlanifiee.Phase.nomPhase }}</td>
                                                        <td>{{ tache.phasePlanifiee.ProcedurePlanifiee.acProcedure.nomProcedure }}</td>
                                                        <td><center><a href="{{ path('cnam_actiman_control_menuVisualiserAgent', {'idtache':tache.id, 'iduser':tache.user.id}) }}"><i class="fa fa-eye"> Visualiser</i></a></center></td>
                                                    </tr>
                                                {% endif %}
                                            {% endfor %}
                                        </tbody>
                                    {% endif %}
                                </table>
                            </div>
                        </div>
                    </div>  
                    {% endif %}             
                {% endfor %}
            </div>
        </div>   
    {% endblock%}
    
{% endblock%}{# empty Twig template #}
